﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Flow_AddStyleDescription_V2]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Flow_AddStyleDescription_V2];
GO
CREATE PROCEDURE [dbo].[sproc_Flow_AddStyleDescription_V2]
    @StyleID int,
    @FieldName nvarchar(100),
    @FieldDescription nvarchar(100),
    @Judged bit,
    @MultiLine bit,    
    @Height int,
    @Width int,
    @Position int,
    @Example nvarchar(100)
AS
BEGIN
SET NOCOUNT ON;

IF NOT EXISTS(SELECT 1 FROM dbo.uds_flow_Style_Description WHERE field_name = @FieldName AND Style_ID = @StyleID)
BEGIN
    INSERT INTO dbo.uds_flow_Style_Description 
        (
            Style_ID,
            Field_Name,
            Field_Description,
            Judged,
            MultiLine,Height,
            Width,
            Position,
            Example
        )
        VALUES
        (
            @StyleID,
            @FieldName,
            @FieldDescription,
            @Judged,
            @MultiLine,    
            @Height,
            @Width,
            @Position,
            @Example
        );

    RETURN 0;
END;

RETURN -1

END
GO